import csv
headers = ['name','price','author']
values = [
	{"name":'流浪地球',"price":18,"author":'刘慈欣'},
	{"name":'梦的解析',"price":30,"author":'弗洛伊德'},
	{"name":'时间简史',"price":35,"author":'斯蒂芬·威廉·霍金'}
]
with open('book2.csv','w',newline='') as fp:
	writer=csv.DictWriter(fp,headers)
	writer.writerow({"name":'三体',"price":20,"author":'刘慈欣'})
	writer.writerows(values)
